﻿using Eqwww.Domain.Models.Identity;
using Eqwww.Domain.Models.SystemManage;
using System;
using System.ComponentModel.DataAnnotations;

namespace Eqwww.Domain.Models.QuartzJob
{
    /// <summary>
    /// 任务计划表
    /// </summary>
    public class ScheduleModel : ICreateAudited, ILastUpdateAudited, IDeleteAudited
    {
        public string Id { get; set; }
        [Display(Name = "创建人")]
        public string CreateUserId { get; set; }
        public virtual UserModel CreateUser { get; set; }
        [Display(Name = "创建时间")]
        public DateTime? CreateTime { get; set; }
        [Display(Name = "最后更新人")]
        public string LastUpdateUserId { get; set; }
        public virtual UserModel LastUpdateUser { get; set; }
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdateTime { get; set; }
        [Display(Name = "删除标识")]
        public bool? DeleteMark { get; set; }
        [Display(Name = "删除人")]
        public string DeleteUserId { get; set; }
        public virtual UserModel DeleteUser { get; set; }
        [Display(Name = "删除时间")]
        public DateTime? DeleteTime { get; set; }

        /// <summary>
        /// 任务名称
        /// </summary>
        public string JobName { get; set; }
        /// <summary>
        /// 任务分组
        /// </summary>
        public string JobGroup { get; set; }
        /// <summary>
        /// 状态， 0 暂停任务；1 启用任务
        /// </summary>
        public int? JobStatus { get; set; }
        /// <summary>
        /// 任务运行时间表达式
        /// </summary>
        public string Cron { get; set; }
        /// <summary>
        /// 任务所在DLL对应的程序集名称
        /// </summary>
        public string AssemblyName { get; set; }
        /// <summary>
        /// 任务所在类
        /// </summary>
        public string ClassName { get; set; }
        /// <summary>
        /// 任务描述
        /// </summary>
        public string Remark { get; set; }

        /// <summary>
        /// 执行次数
        /// </summary>
        public int? RunTimes { get; set; }
        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime BeginTime { get; set; }
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndTime { get; set; }
        /// <summary>
        /// 触发器类型（0、simple 1、cron）
        /// </summary>
        public int? TriggerType { get; set; }
        /// <summary>
        /// 执行间隔时间, 秒为单位
        /// </summary>
        public int? IntervalSecond { get; set; }
        /// <summary>
        /// job调用外部的url
        /// </summary>
        public string Url { get; set; }

        public bool? DbContext { get; set; }

    }
}
